SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION [dbo].[FN_FACTURAS_TIMPUESTOS] (@ID AS NUMERIC(10,0)) RETURNS NUMERIC(10,2)
AS
BEGIN
DECLARE @TOTAL AS NUMERIC(10,2)
				
	SELECT @TOTAL =ISNULL(SUM(IMPUESTO),0)FROM FACTURAS_DETALLES WHERE ID = @ID
		
RETURN @TOTAL
END
GO
